<?php 
namespace app\admin\controller;
use \think\Controller;
class Register extends Comm{
    public function index(){
       if(request()->isPost()){
          if(request()->isPost()){
            $admin = model('admin');
            $e = $admin->validate(true)->allowField(true)->save(input('post.'));
            
            if($e === false){
              $this->error($admin->getError());
            }else{
              $this->success('注册成功啦','/index/index/index');
            }
          }


       }
       return $this->fetch();
    }
    
}
